import request from '@/utils/request'

//查询菜单列表
export function listMenu(query) {
  return request({
    url: '/zxm/application/list',
    method: 'get',
    params: query
  })
}

export function listMenu1(parentId) {
  return request({
    url: '/zxm/application/'+parentId,
    method: 'get',
  })
}

//查询常规应用
export function listNormal(query) {
  return request({
    url: '/zxm/application/normal',
    method: 'get',
    params: query
  })
}

//查询username
export function  listsecurity(username) {
  return request({
    url: '/user/wx/security/'+username,
    method: 'get',
  })
}

//验证密保问题
export function  listquestion(data) {
  return request({
    url: '/user/wx/question/',
    method: 'post',
    data: data
  })
}

//输入新密码
export function  listresetPwd(newPassword,a) {
  return request({
    url: '/user/wx/resetPwd/'+newPassword+"/"+a,
    method: 'post',
  })
}




// 查询菜单详细
export function getMenu(menuId) {
  return request({
    url: '/zxm/application/' + menuId,
    method: 'get'
  })
}

export function getRouter(menuId) {
  return request({
    url: '/zxm/application/router/' + menuId,
    method: 'get'
  })
}

//根据menuID查找这条list的信息
export function getNumber(menuId) {
  return request({
    url: '/zxm/application/number/' + menuId,
    method: 'get'
  })
}

// 查询菜单下拉树结构
export function treeselect() {
  return request({
    url: '/system/menu/treeselect',
    method: 'get'
  })
}



// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId) {
  return request({
    url: '/system/menu/roleMenuTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增菜单
export function addMenu(data) {
  return request({
    url: '/system/menu',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateMenu(data) {
  return request({
    url: '/system/menu',
    method: 'put',
    data: data
  })
}



// 删除菜单
export function delMenu(menuId) {
  return request({
    url: '/system/menu/' + menuId,
    method: 'delete'
  })
}
